]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
Make it possible to not show the users name permanently
authorMatthias Clasen <mclasen@redhat.com>
Sun, 18 Nov 2012 04:51:06 +0000 (23:51 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 24 Nov 2012 22:11:19 +0000 (17:11 -0500)
In particular on the lock screen, this can be a privacy issue.
https://bugzilla.gnome.org/show_bug.cgi?id=688577

data/org.gnome.shell.gschema.xml.in.in
js/ui/userMenu.js

index eaeb01aae9eac4f6c91f7e75e107aabc33c50f09..5e09cbd49cec32de3a0244341ff9148135e4ec13 100644 (file)
@@ -65,6 +65,11 @@ value here is from the GsmPresenceStatus enumeration.</_summary>
         menuitem in single-user, single-session situations.
       </_description>
     </key>
+    <key name="show-full-name" type="b">
+      <default>true</default>
+      <_summary>Show full name in the user menu</_summary>
+      <_description>Whether the users full name is shown in the user menu or not.</_description>
+    </key>
     <child name="calendar" schema="org.gnome.shell.calendar"/>
     <child name="recorder" schema="org.gnome.shell.recorder"/>
     <child name="keybindings" schema="org.gnome.shell.keybindings"/>
index ebfcb0e8441ae2f9f03c84137410623edda16040..dbe2ed66bcdc3b8f01ae5feefd7fc5f634b103bd 100644 (file)
@@ -27,6 +27,7 @@ const DISABLE_LOCK_SCREEN_KEY = 'disable-lock-screen';
 const DISABLE_LOG_OUT_KEY = 'disable-log-out';
 const LOCK_ENABLED_KEY = 'lock-enabled';
 const ALWAYS_SHOW_LOG_OUT_KEY = 'always-show-log-out';
+const SHOW_FULL_NAME_KEY = 'show-full-name';
 
 const DIALOG_ICON_SIZE = 64;
 
@@ -550,9 +551,12 @@ const UserMenuButton = new Lang.Class({
                                        Lang.bind(this, this._updateSwitchUser));
         this._lockdownSettings.connect('changed::' + DISABLE_LOG_OUT_KEY,
                                        Lang.bind(this, this._updateLogout));
-
         this._lockdownSettings.connect('changed::' + DISABLE_LOCK_SCREEN_KEY,
                                        Lang.bind(this, this._updateLockScreen));
+        this._screenSaverSettings.connect('changed::' + SHOW_FULL_NAME_KEY,
+                                           Lang.bind(this, this._updateUserName));
+        global.settings.connect('changed::' + SHOW_FULL_NAME_KEY,
+                                Lang.bind(this, this._updateUserName));
         this._updateSwitchUser();
         this._updateLogout();
         this._updateLockScreen();
@@ -597,7 +601,10 @@ const UserMenuButton = new Lang.Class({
     },
 
     _updateUserName: function() {
-        if (this._user.is_loaded)
+        let settings = global.settings;
+        if (Main.sessionMode.isLocked)
+            settings = this._screenSaverSettings;
+        if (this._user.is_loaded && settings.get_boolean(SHOW_FULL_NAME_KEY))
             this._name.set_text(this._user.get_real_name());
         else
             this._name.set_text("");